package server.conf;

import server.HttpServlet;

/**
 * @author bwcx_jzy
 * @since 2021/11/19
 */
public class ServletWrapper {

    private String name;
    private String className;
    private String url;
    private HttpServlet httpServlet;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getClassName() {
        return className;
    }

    public void loadClassName(String className, ClassLoader classLoader) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
        this.className = className;
        this.httpServlet = (HttpServlet) classLoader.loadClass(className).newInstance();
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public HttpServlet getHttpServlet() {
        return httpServlet;
    }
}
